package com.hearwego;

import com.hearwego.utilities.Utilities;

import android.content.Context;
import android.content.Intent;
import android.content.SharedPreferences;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.view.View.OnClickListener;
import android.widget.Button;

public class TabHomeFragment extends BaseFragment {
    private Button bt_categorias, bt_mapa;
    SharedPreferences preferences;
	SharedPreferences.Editor editor;
	
    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container,
            Bundle savedInstanceState) {
        View view       =   inflater.inflate(R.layout.tab_home, container, false);
        preferences= mActivity.getSharedPreferences("Preferencias",Context.MODE_PRIVATE);
		editor = preferences.edit();
		
		bt_categorias =   (Button) view.findViewById(R.id.bt_categorias);
		bt_mapa = (Button) view.findViewById(R.id.bt_mapa);
		bt_categorias.setOnClickListener(new OnClickListener() {
			
			@Override
			public void onClick(View v) {
				/* Go to next fragment in navigation stack*/
	            mActivity.pushFragments(Utilities.TAB_A, new TabCategoriasFragment(),true,true);				
			}
		});
		bt_mapa.setOnClickListener(new OnClickListener() {
			
			@Override
			public void onClick(View v) {
				/* Go to next fragment in navigation stack*/
				Intent map = new Intent(mActivity, ActivityMapa.class);
				startActivity(map);
				
//	            mActivity.pushFragments(Utilities.TAB_A, new TabMapa(),true,true);
			}
		});

        return view;
    }

}










